<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
		<meta name="description" content="">
		<meta name="author" content="">

		<title>Dashboard Template for Bootstrap</title>
		<!-- Bootstrap core CSS -->
		<link th:href="@{/css/bootstrap.min.css}" rel="stylesheet">

		<!-- Custom styles for this template -->
		<link th:href="@{/css/dashboard.css}" rel="stylesheet">


	</head>

	<body>

		<!--插入-->
		<div th:replace="~{commons/commons2::top_bar}"></div>


		<div class="container-fluid">
			<div class="row">

				<!--插入-->
				<div th:replace="~{commons/commons2::side_bar(active='list.html')}"></div>

				<main role="main" class="col-md-9 ml-sm-auto col-lg-10 pt-3 px-4">

					<form th:action="@{/updateEmp}" method="post">
						<div class="form-group">
							<input type="hidden" name="emp_id" th:value="${emp.getEmp_id()}">
							<label>工号</label>
							<input th:value="${emp.getEmp_code()}" type="text" name="emp_code" class="form-control">
						</div>
						<div class="form-group">
							<label>名称</label>
							<input th:value="${emp.getEmp_name()}" type="text" name="emp_name" class="form-control">
						</div>
						<div class="form-group">
							<label>邮箱</label>
							<input th:value="${emp.getEmail()}" type="email" name="email" class="form-control" placeholder="1176244270@qq.com">
						</div>
						<div class="form-group">
							<label>性别</label><br>
							<div class="form-check form-check-inline">
								<input  th:checked="${emp.getGender()==1}" class="form-check-input" type="radio" name="gender" value="1">
								<label class="form-check-label">男</label>
							</div>
							<div class="form-check form-check-inline">
								<input  th:checked="${emp.getGender()==0}" class="form-check-input" type="radio" name="gender" value="0">
								<label class="form-check-label">女</label>
							</div>
						</div>
						<div class="form-group">
							<label>部门编码</label>
							<!--我们在controller中接受的是一个 Employee 所以我们需要提交的是其中一个属性	-->
							<select class="form-control" name="dept_code">
								<!--th:each="dept:${departments}" 相当于循环哦 ,  th:select 判断默认显示（回显的数据）-->
								<option th:each="dept:${departments}" th:selected="${dept.getDept_code()==emp.getDept_code()}"  th:text="${dept.getDept_code()}" th:value="${dept.getDept_code()}"></option>
							</select>
						</div>
						<div class="form-group">
							<label>出生年月</label>
							<input th:value="${#dates.format(emp.getBirth(),'yyyy-MM-dd')}" type="date"  name="birth" class="form-control">
							<!--<input th:value="${emp.getBirth()}" type="date"  name="birth" class="form-control">-->
						</div>
						<button type="submit" class="btn btn-primary">修改</button>
					</form>

				</main>
			</div>
		</div>

	</body>

</html>